<?php
/**
 * 海外仓-中转库存换标日志
 * (model)
 */
namespace App\Models\OverSeasBa;

use Encore\Admin\Facades\Admin;
use Illuminate\Database\Eloquent\Model;
class BoxTranLog extends Model
{
    protected $table = 'os_b_box_tran_log';

    protected $guarded = [];

    public static function logs($batchNo,$boxNo,$account = [],$fnsku = [],$transferNum = 0,$userId = null){
        self::query()->create([
            'batch_no' => $batchNo,
            'box_no' => $boxNo,
            'oaccount_id' => $account['o'],
            'iaccount_id' => $account['i'],
            'ofnsku' => $fnsku['o'],
            'ifnsku' => $fnsku['i'],
            'transfer_num' => $transferNum,
            'ouser_id' => $userId ?: Admin::user()->id]);
    }
}
